package com.songhq.data.log;

import feign.Logger;
import feign.Logger.Level;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.openfeign.DefaultFeignLoggerFactory;
import org.springframework.cloud.openfeign.FeignLoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignClientConfig
{
  @Bean
  Logger.Level feignLoggerLevel()
  {
    return Logger.Level.FULL;
  }
  @Bean
  @ConditionalOnMissingBean({FeignLoggerFactory.class})
  public FeignLoggerFactory feignLoggerFactory() {
    return new DefaultFeignLoggerFactory(new FeignLog("LOG_FEIGN"));
  }
}